// import "css-loader../css/index.css";
// import "css-loader?modules!../css/index.css";
import '../css/index.css'
import '../css/component.less'

import 海边 from '../img/海边.jpg'

function component() {
  const element = document.createElement('div')

  element.innerHTML = ['Hello', 'Webpack'].join(' ')
  element.className = 'content'

  // 创建一个img元素，设置src属性
  const imgEl = new Image()
  // imgEl.src = require('../img/海边.jpg').default
  imgEl.src = 海边
  element.appendChild(imgEl)

  // 创建一个div，设置背景图片
  const bgDiv = document.createElement('div')
  bgDiv.style.width = 200 + 'px'
  bgDiv.style.height = 200 + 'px'
  bgDiv.className = 'bg-image'
  bgDiv.style.backgroundColor = 'red'
  element.appendChild(bgDiv)

  return element
}

document.body.appendChild(component())
